﻿using System;
using System.Collections.Generic;
using System.Text;

namespace gChartSharp
{
    public class ExtendedEncoder : IEncoder
    {
        private static readonly char[] c_encodingValues = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-.".ToCharArray();

        public string Encode(float num)
        {
            int number = Convert.ToInt32(num);
            int upper = number >> 6;
            int lower = number % 64;
            return string.Format("{0}{1}", c_encodingValues[upper], c_encodingValues[lower]);
        }

    }
}
